package winOrDie.graphics.maps;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * This class provides the WinOrDie map cell structure
 */
public class Map_Cell 
{

	/**
	 * This public static class defines the different {@link Map_Cell} types
	 */
	public static class Map_Cell_Type
	{
		public static final int Corridor = 0;
		public static final int Wall = 1;
		public static final int Pirates_Room = 2;
		public static final int Tower = 3;
		public static final int Tower_Door = 4;
		public static final int Exit = 5;
	}
	
	/**
	 * This public static class defines the different {@link Map_Cell} visibilities
	 */
	public static class Map_Cell_Visibility
	{
		public static int Dark = 0;
		public static int Penumbra = 1;
		public static int Visible = 2;
	}
	
	
	
	private int type = 0;
	private int visibility = 0;
	private String image = null;
	
	/**
	 * This public method returns the {@link Map_Cell} type property
	 * @return int
	 */
	public int getType() {
		return type;
	}
	
	/**
	 * This public method allows to set the {@link Map_Cell} type property
	 * @param type
	 */
	public void setType(int type) {
		this.type = type;
	}
	
	/**
	 * This public method returns the {@link Map_Cell} visibility property
	 * @return int
	 */
	public int getVisibility() {
		return visibility;
	}
	
	/**
	 * This public method allows to set the {@link Map_Cell} visibility property
	 * @param visibility
	 */
	public void setVisibility(int visibility) {
		this.visibility = visibility;
	}
	
	/**
	 * This public method returns the {@link Map_Cell} Image property
	 * @return
	 */
	public String getImage() {
		return image;
	}
	
	/**
	 * This public method allows to set the {@link Map_Cell} Image property
	 * @param image
	 */
	public void setImage(String image) {
		this.image = image;
	}
	
	/**
	 * This public method loads {@link Map_Cell} data from {@link Element} object passed as parameter
	 * @param element
	 * @throws Exception
	 */
	public void load_From_XML_Element(Element element) throws Exception
	{
		Map_Cell_Editor.load_Map_Cell_From_Element(this, element);
	}
	
	/**
	 * This public method returns {@link Element} object that contains {@link Map_Cell} data
	 * @param document
	 * @return {@link Element}
	 * @throws Exception
	 */
	public Element get_XML_Element(Document document) throws Exception
	{
		return Map_Cell_Editor.get_Element_From_Map_Cell(this, document);
	}
	
}
